/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.app;

import java.util.List;
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;

public class JasperReportTemplate {

    public void printToPdf(List<DVCassette> data) throws JRException {
        try {
            JasperReport jr = JasperCompileManager.compileReport("src/main/resources/reportApp.jrxml");
            JasperPrint jp = JasperFillManager.fillReport(jr, null, new JRBeanCollectionDataSource(data));
            JasperPrintManager.printReport(jp, true);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
